import { MiddlewareConsumer, Module, NestModule ,RequestMethod } from '@nestjs/common';
import { CoreMoudle } from './core/core.moudle';
import { LoggerMiddleware } from './core/middleware/logger.middleware';
import { UserController } from './core/controller/user.controller';
import cors from 'cors';
import { APP_FILTER } from '@nestjs/core';
import { HttpExceptionFilter } from './core/filter/HttpExceptionFilter';
@Module({
  imports: [CoreMoudle],
  controllers: [],
  providers: [
    {
      provide:APP_FILTER,
      useClass:HttpExceptionFilter,
    }
  ],
})
export class AppModule {
  // configure(consumer: MiddlewareConsumer) {
    // consumer.apply(LoggerMiddleware,cors).forRoutes(UserController);
    //npm install @types/cors
  // }
}
